<?php
require_once('header.php');

$found_users = User::find_by_unsubscribed();
//view($found_users);
?>
<section>
    <header>
            <?php include_once('nav.edit.php'); ?>
    </header>
        
    <div class="table-frame padding">
        
     <table class="subscription-table">
         <thead>
            <tr class="heading-row skin-gradient">
                <th class="width-400" colspan="4">Search Results - Found <?php echo ( $found_users ) ? count($found_users) : 'no results'; ?></th>
            </tr>
            
        </thead>
            <tr>
                 <th>User ID</th>
                 <th>User Name</th>
                 <th>Registered</th>
                 <th>Location</th>
             </tr>
         <tbody>
             
             <?php 
             if ( $found_users ) {
                 foreach($found_users as $user ) : ?>
                 <tr>
                    <td> <?php  echo $user->user_id; ?> </td>
                    <td> <?php  $user->edit_link(); ?></td>
                    <td> <?php  echo date("F j Y", strtotime($user->user_datestamp)); ?> </td>
                    <td> <?php  echo $user->get_location(); ?> </td>
                </tr>
                <?php 
                endforeach;
             } 
             ?>
         </tbody>
    </table>
</div>
</section>
<?php require_once('footer.php');
